import request from './request'
import { useUserStore } from "../store/modules/user"
// 获取企业信息
export function getCustomerInfo() {
    let token = {
        'access-token': useUserStore().token
    }
    return request({
        url: '/system/customer/getCustomerInfo',
        method: 'get',
        headers: token
    })
}

// 修改企业信息
export function updateCustomer(data) {
    let token = {
        'access-token': useUserStore().token
    }
    return request({
        url: '/system/customer/updateCustomer',
        method: 'PUT',
        headers: token,
        data
    })
}

// 获取系统全局设置
export function getSysSetOverall() {
    let token = {
        'access-token': useUserStore().token
    }
    return request({
        url: '/set/getSysSetOverall',
        method: 'get',
        headers: token
    })
}

// 更新系统全局设置
export function saveSysSetOverall(data: any) {
    let token = {
        'access-token': useUserStore().token
    }
    return request({
        url: '/set/saveSysSetOverall',
        method: 'put',
        headers: token,
        data
    })
}

// 上传Logo
export function logoUpload(data: any) {
    
    return request({
        url: '/logo/logoUpload',
        method: 'post',
        headers: { 'access-token': useUserStore().token, 'Content-Type': 'multipart/form-data' },
        data
    })
}

// 获取知识库查看权限
export function getKnowledgerSelectAuthor() {
    let token = {
        'access-token': useUserStore().token
    }
    return request({
        url: '/set/getKnowledgerSelectAuthor',
        method: 'get',
        headers: token
    })
}